package com.ssm.springboot.controller;


import com.ssm.springboot.pojo.DataInfo;
import com.ssm.springboot.util.UploadUtils;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
public class UploadController {

    @RequestMapping("/upload")
    public DataInfo upload(@RequestParam("file") MultipartFile multipartFile){
        String upload = UploadUtils.upload(multipartFile);
        return new DataInfo(0,"上传成功",0L,upload);
    }
}
